package com.hcbd.tdwt.ui.xingyu.activity;
import android.annotation.SuppressLint;
import android.view.View;
import android.widget.RadioButton;


import com.hcbd.tdwt.R;
import com.hcbd.tdwt.base.BaseActivity;
import com.hcbd.tdwt.base.BaseFragment;
import com.hcbd.tdwt.base.bd.BdToolFactory;
import com.hcbd.tdwt.ui.xingyu.fragment.AppLocationUpFragment_;
import com.hcbd.tdwt.ui.xingyu.fragment.BdLocationUpFragment_;
import com.hcbd.tdwt.ui.xingyu.fragment.GroundToneUploadFragment;
import com.hcbd.tdwt.ui.xingyu.fragment.GroundToneUploadFragment_;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.CheckedChange;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;

//星宇定位上传页
@SuppressLint("NonConstantResourceId")
@EActivity(R.layout.activity_location_upload)
public class LocationUploadActivity extends BaseActivity {
    @ViewById
    RadioButton appLocationUp,bdLocationUp;

    BaseFragment appLocationUpFragment;
    //BaseFragment groundToneUploadFragment;
    BdLocationUpFragment_ bdLocationUpFragment;

    @AfterViews
    protected void init() {
        bdLocationUpFragment=new BdLocationUpFragment_();
        if(BdToolFactory.MOBILE_PHONE_TYPE==BdToolFactory.SATELLITE_MOBILE_PHONE){
            bdLocationUp.setVisibility(View.GONE);
            appLocationUpFragment=new AppLocationUpFragment_();
            appLocationUp.setBackground(null);
            appLocationUp.setText("APP上报");
            appLocationUp.setTextSize(18);
        }else{
            appLocationUpFragment=new GroundToneUploadFragment_();
        }
        appLocationUp.setChecked(true);
    }
    @CheckedChange
    void appLocationUp(boolean isChecked){
        if(isChecked) {
            switchFragment(appLocationUpFragment, R.id.resultLL);
        }
    }
    @CheckedChange
    void bdLocationUp(boolean isChecked){
        if(isChecked) {
            switchFragment(bdLocationUpFragment, R.id.resultLL);
        }
    }




    @Click
    void headLeft(){
        finish();
    }
}
